public class TypeInference<T>{
    private T value;
    //判断当前输入的整数还是小数


    public void setValue(T value) {
        this.value = value;
    }

    public static void main(String[] args) {
        TypeInference<Object> objectTypeInference = new TypeInference<>();
        objectTypeInference.setValue(10.0f);
        if(objectTypeInference.value instanceof Integer){
            System.out.println("整数");
        }
        else if(objectTypeInference.value instanceof Double){
            System.out.println("小数");
        }else {
            System.out.println("其他");
        }
        }

    }
